package com.lsh.repository;

import com.lsh.entity.Monitor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author ：LiuShihao
 * @date ：Created in 2020/10/18 4:29 下午
 * @desc ：
 */

public interface MonitorRepository extends JpaRepository<Monitor,Integer>, JpaSpecificationExecutor<Monitor> {

    @Query(value ="SELECT * FROM `monitor` WHERE `start_time` >= '8' AND end_time <='24' AND `flag` != '1' " ,nativeQuery = true)
    List<Monitor> findByStart_timeAfter8AndEnd_timeBefore24AndFlagIsNot1();
}
